<% _.each(associationTypes, function (associationType) { %>
<div
  class="AknTabHeader association-type<% if (associationType.code !== currentAssociationType) { %> AknTitleContainer--hidden<% } %>"
  data-association-type="<%- associationType.code %>"
>
  <div class="AknButtonList">
    <div class="AknDropdown AknButtonList-item association-type-selector">
      <a class="AknActionButton AknActionButton--important AknActionButton--withoutBorder" data-toggle="dropdown">
        <span class="AknActionButton-highlight"
          ><%- getLabel(associationType.labels, locale, associationType.code) %></span
        >
        <span class="AknActionButton-caret"></span>
      </a>
      <ul class="associations-list AknDropdown-menu">
        <div class="AknDropdown-menuTitle"><%- label %></div>
        <% _.each(associationTypes, function (associationTypeSwitch) { %>
        <li data-association-type="<%- associationTypeSwitch.code %>">
          <a
            class="AknDropdown-menuLink<% if (associationType === associationTypeSwitch) { %> AknDropdown-menuLink--active<% } %> label"
          >
            <%- `${getLabel(associationTypeSwitch.labels, locale, associationTypeSwitch.code)}
            (${associationTypeSwitch.productCount + associationTypeSwitch.productModelCount +
            associationTypeSwitch.groupCount})` %>
          </a>
        </li>
        <% }) %>
      </ul>
    </div>
    <div class="AknButtonList-item">
      <%- __( numberAssociationLabelKey, { productCount: associationType.productCount, productModelCount:
      associationType.productModelCount, groupCount: associationType.groupCount } ) %>
    </div>
  </div>
  <div class="AknDropdown target-selector <%- isQuantifiedAssociation && 'hide' %>">
    <a class="AknActionButton AknActionButton--withoutBorder" data-toggle="dropdown">
      <span class="AknActionButton-highlight">
        <% if ('products' === currentAssociationTarget) { %> <%- showProductsLabel %> <% } else { %> <%- showGroupsLabel
        %> <% } %>
      </span>
      <span class="AknActionButton-caret"></span>
    </a>
    <ul class="AknDropdown-menu">
      <div class="AknDropdown-menuTitle"><%- targetLabel %></div>
      <li
        class="label target-button AknDropdown-menuLink<% if ('products' === currentAssociationTarget) { %> AknDropdown-menuLink--active<% } %>"
        data-association-target="products"
      >
        <%- showProductsLabel %>
      </li>
      <li
        class="label target-button AknDropdown-menuLink<% if ('groups' === currentAssociationTarget) { %> AknDropdown-menuLink--active<% } %>"
        data-association-target="groups"
      >
        <%- showGroupsLabel %>
      </li>
    </ul>
  </div>
</div>
<% }); %>
